package net.common.service;

import net.common.hibernate.HibernateSessionFactory;


/**
 * 
 * 
 * @author 业务类父类，主要包括事物处理
 * 
 */
public abstract class GeneralService implements GeneralServiceInterface {

	protected PageBean pageBean;

	/**
	 * 子类业务处理方法
	 * 
	 */
	public abstract void execute() throws Exception;

	/**
	 * 执行业务处理方法
	 * 
	 */
	public void invoke() throws Exception {
		try {
			execute();
		} catch (Exception e) {
			HibernateSessionFactory.closeSession(false);
			throw new Exception(e);
		} 
		HibernateSessionFactory.closeSession(true);
	}

	public PageBean getPageBean() {
		return pageBean;
	}

	public void setPageBean(PageBean pageBean) {
		this.pageBean = pageBean;
	}
}
